package sm.upgrade.converter;

import java.util.Map;

import sm.codec.type.Logical;
import sm.dam.api.Converter;

public class LogicalToAlwaysNeverConverter implements Converter {

	@Override
	public Object convert(Object value, Map<String, Object> owner) {
		Object newValue = value;
		if (value instanceof Logical) {
			Logical logical = (Logical) value;
			if (logical.equals(Logical.TRUE)) {
				newValue = "always";
			} else {
				newValue = "never";
			}
		}
		return newValue;
	}

}
